Position detection device for detecting position of an object moving in a predetermined direction, and a magnetic sensor for use with the position detection device

ABSTRACT

A position detection device includes a first magnetic field generation unit for generating a first magnetic field, a second magnetic field generation unit for generating a second magnetic field, and a magnetic sensor. The position of the second magnetic field generation unit relative to the first magnetic field generation unit is variable. The magnetic sensor detects the direction of a target magnetic field at a detection position in a reference plane. The target magnetic field is a composite magnetic field of first and second magnetic field components which are respective components of the first and second magnetic fields parallel to the reference plane. The magnetic sensor includes a magnetoresistive element including a free layer and a magnetization pinned layer. In the reference plane, two directions orthogonal to the magnetization direction of the magnetization pinned layer are each different from both of directions of the first and second magnetic field components.

This is a Continuation Application of U.S. patent application Ser. No.16/123,513 filed Sep. 6, 2018, which claims the benefit of JapanesePatent Application No. 2017-210918 filed Oct. 31, 2017. The disclosureof the prior applications is hereby incorporated by reference herein inits entirety.

BACKGROUND OF THE INVENTION 1. Field of the Invention

The present invention relates to a magnetic sensor, and a positiondetection device using the magnetic sensor.

2. Description of the Related Art

Position detection devices using magnetic sensors have been used for avariety of applications. The position detection devices using magneticsensors will hereinafter be referred to as magnetic position detectiondevices. For example, the magnetic position detection devices are usedfor detecting a lens position in a camera module having an autofocusmechanism incorporated in a smartphone.

US 2016/0231528 A1 discloses a technique of detecting a composite vectorwith a position sensor in an autofocus mechanism in which a lens ismovably coupled to a substrate. The composite vector is generated byinteraction between a first magnetic field having a constant strength ina first direction and a second magnetic field in a second directiongenerated by a magnet that moves with the lens. The second direction isorthogonal to the first direction. According to the technique, themagnitude of the second magnetic field varies depending on the lensposition, and as a result, the angle that the composite vector formswith the second direction, which will hereinafter be referred to as thecomposite vector angle, also varies.

US 2007/0047152 A1 discloses a magnetic field detection apparatus thatuses a magnetoresistive element of spin valve structure. This apparatusincludes a bias unit for applying a bias magnetic field to themagnetoresistive element to change the characteristic of a resistancevalue of the magnetoresistive element to an external magnetic field.

JP 2016-223894A discloses a magnetic sensor including a rectangularsubstrate, and a first and a second magnetoresistive element formed onthe substrate and connected to each other. A current path of the firstmagnetoresistive element is formed in a first direction that forms apredetermined angle with a side of the substrate. A current path of thesecond magnetoresistive element is formed in a second directionorthogonal to the first direction.

According to the technique disclosed in US 2016/0231528 A1, it ispossible to detect the lens position by detecting the composite vectorangle.

As described in US 2007/0047152 A1, the magnetoresistive element of spinvalve structure is unable to correctly detect a magnetic field withoutusing a linear characteristic area of the magnetoresistive element. Thelinear characteristic area of a magnetoresistive element refers to, in acharacteristic diagram representing the relationship between a magneticfield applied to the magnetoresistive element and a resistance value ofthe magnetoresistive element, an area in which the resistance value ofthe magnetoresistive element varies linearly or substantially linearlywith respect to changes in the applied magnetic field. US 2007/0047152A1 describes a technology to vary the characteristic of the resistancevalue of the magnetoresistive element to an external magnetic field byapplying a bias magnetic field to the magnetoresistive element.

Now, consider a position detection device for detecting the position ofa target object such as a lens by detecting the composite vector angleas described in, e.g., US 2016/0231528 A1, using a magnetic sensorincluding a magnetoresistive element. For such a position detectiondevice, the variable range of the composite vector angle is determinedaccording to the movable range of the target object. Conventionally, noconsideration has been given to enhancing the detection accuracy of themagnetic sensor including a magnetoresistive element in the variablerange of the composite vector angle.

SUMMARY OF THE INVENTION

It is an object of the present invention to provide a position detectiondevice that uses a magnetic sensor and is capable of performing positiondetection with high accuracy, and to provide a magnetic sensor suitablefor use in the position detection device.

A position detection device of the present invention includes a firstmagnetic field generation unit for generating a first magnetic field, asecond magnetic field generation unit for generating a second magneticfield, and a magnetic sensor. The second magnetic field generation unitis provided such that its position relative to the first magnetic fieldgeneration unit is variable. The magnetic sensor generates a detectionsignal corresponding to the direction of a detection-target magneticfield at a detection position in a reference plane.

The magnetic sensor includes at least one magnetoresistive element. Theat least one magnetoresistive element includes a magnetization pinnedlayer having a magnetization whose direction is fixed, and a free layerhaving a magnetization whose direction is variable according to thedirection of the detection-target magnetic field. The reference plane isa plane that contains the direction of the magnetization of themagnetization pinned layer and the direction of the detection-targetmagnetic field.

When the position of the second magnetic field generation unit relativeto the first magnetic field generation unit varies, the strength of asecond magnetic field component varies whereas none of the strength anddirection of a first magnetic field component and the direction of thesecond magnetic field component vary, where the first magnetic fieldcomponent is a component of the first magnetic field at the detectionposition, the component of the first magnetic field being parallel tothe reference plane, and the second magnetic field component is acomponent of the second magnetic field at the detection position, thecomponent of the second magnetic field being parallel to the referenceplane. The detection-target magnetic field is a composite magnetic fieldof the first magnetic field component and the second magnetic fieldcomponent. In the reference plane, each of two directions orthogonal tothe direction of the magnetization of the magnetization pinned layer isdifferent from both of the direction of the first magnetic fieldcomponent and the direction of the second magnetic field component.

In the position detection device of the present invention, the directionof the second magnetic field component may be orthogonal to thedirection of the first magnetic field component.

In the position detection device of the present invention, a variationin the position of the second magnetic field generation unit relative tothe first magnetic field generation unit may vary the distance betweenthe detection position and the second magnetic field generation unit.

In the position detection device of the present invention, one of thetwo directions orthogonal to the direction of the magnetization of themagnetization pinned layer may be contained in a variable range of thedirection of the detection-target magnetic field, the variable rangecorresponding to a movable range of the position of the second magneticfield generation unit relative to the first magnetic field generationunit. In this case, the one of the two directions orthogonal to thedirection of the magnetization of the magnetization pinned layer may bethe same as a direction in the middle of the variable range of thedirection of the detection-target magnetic field. When the position ofthe second magnetic field generation unit relative to the first magneticfield generation unit is in the middle of the movable range of theposition of the second magnetic field generation unit relative to thefirst magnetic field generation unit, the direction of thedetection-target magnetic field may be the same as the one of the twodirections orthogonal to the direction of the magnetization of themagnetization pinned layer.

In the position detection device of the present invention, the firstmagnetic field generation unit may include two magnets disposed atdifferent positions. In this case, the first magnetic field may be acomposite of two magnetic fields that are respectively generated by thetwo magnets.

The position detection device of the present invention may furtherinclude a first holding member for holding the first magnetic fieldgeneration unit, and a second holding member for holding the secondmagnetic field generation unit, the second holding member being providedsuch that its position is variable in one direction relative to thefirst holding member. In this case, the second holding member may beconfigured to hold a lens, and may be provided such that its position isvariable in a direction of an optical axis of the lens relative to thefirst holding member.

A magnetic sensor of the present invention is configured to generate, ata detection position in a reference plane, a detection signalcorresponding to the direction of a detection-target magnetic field thatvaries within a variable range below 180° in the reference plane. Themagnetic sensor of the present invention includes at least onemagnetoresistive element. The at least one magnetoresistive elementincludes a magnetization pinned layer having a magnetization whosedirection is fixed, and a free layer having a magnetization whosedirection is variable according to the direction of the detection-targetmagnetic field. The reference plane is a plane that contains thedirection of the magnetization of the magnetization pinned layer and thedirection of the detection-target magnetic field. One of two directionsorthogonal to the direction of the magnetization of the magnetizationpinned layer is contained in the variable range of the direction of thedetection-target magnetic field.

In the magnetic sensor of the present invention, the one of the twodirections orthogonal to the direction of the magnetization of themagnetization pinned layer may be the same as a direction in the middleof the variable range of the direction of the detection-target magneticfield. The variable range of the direction of the detection-targetmagnetic field may be below 90°.

In the position detection device and the magnetic sensor of the presentinvention, the at least one magnetoresistive element may be at least onefirst magnetoresistive element and at least one second magnetoresistiveelement. The magnetic sensor may further include a power supply portconfigured to receive a predetermined voltage, a ground port connectedto a ground, and an output port. In this case, the at least one firstmagnetoresistive element is provided between the power supply port andthe output port. The at least one second magnetoresistive element isprovided between the output port and the ground port. The magnetizationof the magnetization pinned layer of the at least one firstmagnetoresistive element is in a first direction. The magnetization ofthe magnetization pinned layer of the at least one secondmagnetoresistive element is in a second direction opposite to the firstdirection. The detection signal depends on an electric potential at theoutput port.

In the position detection device and the magnetic sensor of the presentinvention, the at least one magnetoresistive element may be at least onefirst magnetoresistive element, at least one second magnetoresistiveelement, at least one third magnetoresistive element, and at least onefourth magnetoresistive element. The magnetic sensor may further includea power supply port configured to receive a predetermined voltage, aground port connected to a ground, a first output port, and a secondoutput port. In this case, the at least one first magnetoresistiveelement is provided between the power supply port and the first outputport. The at least one second magnetoresistive element is providedbetween the first output port and the ground port. The at least onethird magnetoresistive element is provided between the power supply portand the second output port. The at least one fourth magnetoresistiveelement is provided between the second output port and the ground port.

The magnetization of the magnetization pinned layer of the at least onefirst magnetoresistive element and the magnetization of themagnetization pinned layer of the at least one fourth magnetoresistiveelement are in a first direction. The magnetization of the magnetizationpinned layer of the at least one second magnetoresistive element and themagnetization of the magnetization pinned layer of the at least onethird magnetoresistive element are in a second direction opposite to thefirst direction. The detection signal depends on a potential differencebetween the first output port and the second output port.

According to the position detection device of the present invention, thedirection of the detection-target magnetic field is different from bothof the direction of the first magnetic field component and the directionof the second magnetic field component, and is between those directions.According to the position detection device of the present invention, inthe reference plane, each of the two directions orthogonal to themagnetization direction of the magnetization pinned layer is differentfrom both of the direction of the first magnetic field component and thedirection of the second magnetic field component. It is thus possiblefor the position detection device of the present invention to bring oneof the two directions orthogonal to the magnetization direction of themagnetization pinned layer close to or within the variable range of thedirection of the detection-target magnetic field. This enablesenhancement of detection accuracy of at least one magnetoresistiveelement in the variable range of the direction of the detection-targetmagnetic field. The position detection device of the present inventionis thus capable of performing position detection with high accuracy.

According to the magnetic sensor of the present invention, one of thetwo directions orthogonal to the magnetization direction of themagnetization pinned layer is contained in the variable range of thedirection of the detection-target magnetic field, which is below 180°.This enables the magnetic sensor of the present invention to detect thedirection of the detection-target magnetic field with high accuracy.

Other and further objects, features and advantages of the presentinvention will appear more fully from the following description.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a perspective view of a camera module including a positiondetection device according to an embodiment of the invention.

FIG. 2 illustrates an internal schematic view of the camera module ofFIG. 1.

FIG. 3 is a perspective view of the position detection device and adriving device according to the embodiment of the invention.

FIG. 4 is a perspective view of a plurality of coils of the drivingdevice of FIG. 1.

FIG. 5 is a side view illustrating the principal parts of the drivingdevice of FIG. 1.

FIG. 6 is a perspective view illustrating the principal parts of theposition detection device according to the embodiment of the invention.

FIG. 7 is a circuit diagram illustrating the configuration of a magneticsensor of the embodiment of the invention.

FIG. 8 is a perspective view of a portion of a resistor section of FIG.7.

FIG. 9 is an explanatory diagram illustrating the magnetizationdirection of a magnetization pinned layer and the directions of firstand second magnetic field components in the embodiment of the invention.

FIG. 10 is a characteristic diagram illustrating the relationshipbetween a relative position P12 and a target angle in the embodiment ofthe invention.

FIG. 11 is an explanatory diagram illustrating the magnetizationdirection of the magnetization pinned layer and the directions of thefirst and second magnetic field components in a comparative example.

FIG. 12 is a characteristic diagram illustrating the relationshipbetween an applied magnetic field angle and a normalized detectionsignal in the comparative example.

FIG. 13 is a characteristic diagram illustrating variations in thenormalized detection signal with varying temperature in the comparativeexample.

FIG. 14 is a characteristic diagram illustrating the relationshipbetween the applied magnetic field angle and the normalized detectionsignal in the embodiment of the invention.

FIG. 15 is a characteristic diagram illustrating variations in thenormalized detection signal with varying temperature in the embodimentof the invention.

FIG. 16 is an explanatory diagram illustrating a linearity parameter inthe embodiment of the invention.

FIG. 17 is a characteristic diagram illustrating the relationship of therelative position P12 and the target angle with the normalized detectionsignal in the comparative example.

FIG. 18 is a characteristic diagram illustrating the relationship of therelative position P12 and the target angle with the linearity parameterin the comparative example.

FIG. 19 is a characteristic diagram illustrating the relationship of therelative position P12 and the target angle with the normalized detectionsignal in the embodiment of the invention.

FIG. 20 is a characteristic diagram illustrating the relationship of therelative position P12 and the target angle with the linearity parameterin the embodiment of the invention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT

A preferred embodiment of the present invention will now be described indetail with reference to the drawings. First, reference is made to FIG.1 and FIG. 2 to describe the configuration of a camera module includinga position detection device according to the embodiment of theinvention. FIG. 1 is a perspective view of the camera module 100. FIG. 2is a schematic internal view of the camera module 100. For ease ofunderstanding, in FIG. 2 the parts of the cameral module 100 are drawnon a different scale and in a different layout than those in FIG. 1. Thecamera module 100 constitutes, for example, a portion of a camera for asmartphone having an optical image stabilization mechanism and anautofocus mechanism, and is used in combination with an image sensor 200that uses CMOS or other similar techniques.

The camera module 100 includes a position detection device 1 accordingto the embodiment, and a driving device 3, a lens 5, a housing 6 and asubstrate 7. The position detection device 1 according to the embodimentis a magnetic position detection device, and is used to detect theposition of the lens 5 during automatic focusing. The driving device 3is to move the lens 5. The housing 6 is to protect the positiondetection device 1 and the driving device 3. The substrate 7 has a topsurface 7 a. FIG. 1 omits the illustration of the substrate 7, and FIG.2 omits the illustration of the housing 6.

Now, we define U, V, and Z directions as shown in FIGS. 1 and 2. The U,V, and Z directions are orthogonal to one another. In the embodiment,the Z direction is a direction perpendicular to the top surface 7 a ofthe substrate 7. In FIG. 2 the Z direction is the upward direction. TheU and V directions are both parallel to the top surface 7 a of thesubstrate 7. The opposite directions to the U, V, and Z directions willbe referred to as −U, −V, and −Z directions, respectively. As usedherein, the term “above” refers to positions located forward of areference position in the Z direction, and “below” refers to positionslocated on a side of the reference position opposite from “above”.

The lens 5 is disposed above the top surface 7 a of the substrate 7 insuch an orientation that the direction of its optical axis is parallelto the Z direction. The substrate 7 has an opening (not illustrated) forpassing light that has passed through the lens 5. As shown in FIG. 2,the camera module 100 is in alignment with the image sensor 200 so thatlight that has passed through the lens 5 and the non-illustrated openingwill enter the image sensor 200.

The position detection device 1 and the driving device 3 according tothe embodiment will now be described in detail with reference to FIG. 2to FIG. 5. FIG. 3 is a perspective view of the position detection device1 and the driving device 3. FIG. 4 is a perspective view of a pluralityof coils of the driving device 3. FIG. 5 is a side view illustrating theprincipal parts of the driving device 3.

The position detection device 1 includes a first holding member 14, asecond holding member 15, a plurality of first wires 16, and a pluralityof second wires 17. The second holding member 15 is to hold the lens 5.Although not illustrated, the second holding member 15 is shaped like ahollow cylinder so that the lens 5 is insertable in the hollow.

The second holding member 15 is provided such that its position isvariable in one direction, specifically, in the direction of the opticalaxis of the lens 5, i.e., a direction parallel to the Z direction,relative to the first holding member 14. In the embodiment, the firstholding member 14 is shaped like a box so that the lens 5 and the secondholding member 15 can be accommodated therein. The plurality of secondwires 17 connect the first and second holding members 14 and 15 andsupport the second holding member 15 such that the second holding member15 is movable in a direction parallel to the Z direction relative to thefirst holding member 14.

The first holding member 14 is provided above the top surface 7 a of thesubstrate 7 such that its position is variable relative to the substrate7 in a direction parallel to the U direction and in a direction parallelto the V direction. The plurality of first wires 16 connect thesubstrate 7 and the first holding member 14, and support the firstholding member 14 such that the first holding member 14 is movablerelative to the substrate 7 in a direction parallel to the U directionand in a direction parallel to the V direction. When the position of thefirst holding member 14 relative to the substrate 7 varies, the positionof the second holding member 15 relative to the substrate 7 also varies.

The driving device 3 includes magnets 31A, 31B, 32A, 32B, 33A, 33B, 34Aand 34B, and coils 41, 42, 43, 44, 45 and 46. The magnet 31A is locatedforward of the lens 5 in the −V direction. The magnet 32A is locatedforward of the lens 5 in the V direction. The magnet 33A is locatedforward of the lens 5 in the −U direction. The magnet 34A is locatedforward of the lens 5 in the U direction. The magnets 31B, 32B, 33B and34B are located above the magnets 31A, 32A, 33A and 34A, respectively.The magnets 31A, 31B, 32A, 32B, 33A, 33B, 34A and 34B are fixed to thefirst holding member 14.

As shown in FIG. 3, the magnets 31A, 31B, 32A and 32B are each in theshape of a rectangular solid that is long in the U direction. Themagnets 33A, 33B, 34A and 34B are each in the shape of a rectangularsolid that is long in the V direction. The magnets 31A and 32B aremagnetized in the V direction. The magnets 31B and 32A are magnetized inthe −V direction. The magnets 33A and 34B are magnetized in the Udirection. The magnets 33B and 34A are magnetized in the −U direction.In FIG. 5, the arrows drawn inside the magnets 31A and 31B indicate themagnetization directions of the magnets 31A and 31B.

The coil 41 is located between the magnet 31A and the substrate 7. Thecoil 42 is located between the magnet 32A and the substrate 7. The coil43 is located between the magnet 33A and the substrate 7. The coil 44 islocated between the magnet 34A and the substrate 7. The coil 45 islocated between the lens 5 and the magnets 31A and 31B. The coil 46 islocated between the lens 5 and the magnets 32A and 32B. The coils 41,42, 43 and 44 are fixed to the substrate 7. The coils 45 and 46 arefixed to the second holding member 15.

The coil 41 is subjected mainly to a magnetic field generated by themagnet 31A. The coil 42 is subjected mainly to a magnetic fieldgenerated by the magnet 32A. The coil 43 is subjected mainly to amagnetic field generated by the magnet 33A. The coil 44 is subjectedmainly to a magnetic field generated by the magnet 34A.

As shown in FIGS. 2, 4 and 5, the coil 45 includes a first conductorportion 45A extending along the magnet 31A in the U direction, a secondconductor portion 45B extending along the magnet 31B in the U direction,and two third conductor portions connecting the first and secondconductor portions 45A and 45B. As shown in FIGS. 2 and 4, the coil 46includes a first conductor portion 46A extending along the magnet 32A inthe U direction, a second conductor portion 46B extending along themagnet 32B in the U direction, and two third conductor portionsconnecting the first and second conductor portions 46A and 46B.

The first conductor portion 45A of the coil 45 is subjected mainly to acomponent in the V direction of the magnetic field generated by themagnet 31A. The second conductor portion 45B of the coil 45 is subjectedmainly to a component in the −V direction of a magnetic field generatedby the magnet 31B. The first conductor portion 46A of the coil 46 issubjected mainly to a component in the −V direction of the magneticfield generated by the magnet 32A. The second conductor portion 46B ofthe coil 46 is subjected mainly to a component in the V direction of amagnetic field generated by the magnet 32B.

The position detection device 1 further includes a first magnetic fieldgeneration unit 11 for generating a first magnetic field, a secondmagnetic field generation unit 12 for generating a second magneticfield, and a magnetic sensor 20. In the embodiment, the first magneticfield generation unit 11 has two magnets disposed at differentpositions. In the embodiment, specifically, the first magnetic fieldgeneration unit 11 has the magnets 31A and 34A as the aforementioned twomagnets. The first magnetic field is a composite of the magnetic fieldsgenerated by the magnets 31A and 34A. As mentioned above, the magnets31A and 34A are fixed to the first holding member 14. The first magneticfield generation unit 11 is thus held by the first holding member 14.

As shown in FIG. 3, the magnet 31A has an end face 31A1 located at theend of the magnet 31A in the U direction. The magnet 34A has an end face34A1 located at the end of the magnet 34A in the −V direction.

The second magnetic field generation unit 12 is provided such that itsposition relative to the first magnetic field generation unit 11 isvariable. In the embodiment, the second magnetic field generation unit12 has a magnet 13. The second magnetic field is a magnetic fieldgenerated by the magnet 13. The magnet 13 is in the shape of arectangular solid. The magnet 13 is fixed to the second holding member15 in a space near the end face 31A1 of the magnet 31A and the end face34A1 of the magnet 34A. The second magnetic field generation unit 12 isthus held by the second holding member 15. When the position of thesecond holding member 15 relative to the first holding member 14 variesin a direction parallel to the Z direction, the position of the secondmagnetic field generation unit 12 relative to the first magnetic fieldgeneration unit 11 also varies in the direction parallel to the Zdirection.

The magnetic sensor 20 includes at least one magnetoresistive (MR)element. The magnetic sensor 20 detects a detection-target magneticfield at a detection position in a reference plane, and generates adetection signal corresponding to the direction of the detection-targetmagnetic field. The detection-target magnetic field will hereinafter bereferred to as the target magnetic field MF. The magnetic sensor 20 isfixed to the substrate 7 in the vicinity of the end face 31A1 of themagnet 31A and the end face 34A1 of the magnet 34A. The distance betweenthe magnet 31A and the magnetic sensor 20 is equal to the distancebetween the magnet 34A and the magnetic sensor 20. The magnet 13 islocated above the magnetic sensor 20.

The detection position is a position at which the magnetic sensor 20detects the first magnetic field and the second magnetic field. In theembodiment, the reference plane is a plane that contains the detectionposition and is perpendicular to the Z direction. When the position ofthe second magnetic field generation unit 12 relative to the firstmagnetic field generation unit 11 varies, the distance between thedetection position and the second magnetic field generation unit 12varies.

A component of the first magnetic field at the detection position, thecomponent being parallel to the reference plane, will be referred to thefirst magnetic field component MF1. A component of the second magneticfield at the detection position, the component being parallel to thereference plane, will be referred to as the second magnetic fieldcomponent MF2. The target magnetic field MF is a composite of the firstmagnetic field component MF1 and the second magnetic field componentMF2. The first and second magnetic field components MF1 and MF2 and thetarget magnetic field MF are shown in FIG. 6 and FIG. 9 to be describedlater.

The positional relationships among the first magnetic field generationunit 11, the second magnetic field generation unit 12 and the magneticsensor 20, and the configuration of the magnetic sensor 20 will bedescribed in more detail later.

The driving device 3 further includes a magnetic sensor 30 disposed onthe inner side of one of the coils 41 and 42 and fixed to the substrate7, and a magnetic sensor 30 disposed on the inner side of one of thecoils 43 and 44 and fixed to the substrate 7. Assume here that the twomagnetic sensors 30 are disposed on the inner sides of the coils 41 and44, respectively. As will be described later, the two magnetic sensors30 are used to adjust the position of the lens 5 to reduce the effect ofhand-induced camera shake.

The magnetic sensor 30 disposed on the inner side of the coil 41 detectsthe magnetic field generated by the magnet 31A and generates a signalcorresponding to the position of the magnet 31A. The magnetic sensor 30disposed on the inner side of the coil 44 detects the magnetic fieldgenerated by the magnet 34A and generates a signal corresponding to theposition of the magnet 34A. For example, the magnetic sensors 30 areconstructed of elements for detecting magnetic fields, such as Hallelements.

The positional relationships among the first magnetic field generationunit 11, the second magnetic field generation unit 12 and the magneticsensor 20 will now be described in detail with reference to FIGS. 3 and6. FIG. 6 is a perspective view illustrating the principal parts of theposition detection device 1. Here, X and Y directions are defined asshown in FIG. 6. Both the X and Y directions are parallel to the topsurface 7 a (see FIG. 2) of the substrate 7. The X direction is thedirection rotated by 45° from the U direction toward the V direction.The Y direction is the direction rotated by 45° from the V directiontoward the −U direction. The opposite directions to the X and Ydirections will be referred to as −X and −Y directions, respectively.

In FIG. 6, the arrow labeled MF1 represents the first magnetic fieldcomponent MF1. In the embodiment, the first magnetic field generationunit 11 and the magnetic sensor 20 are provided to orient the firstmagnetic field component MF1 in the −Y direction. The direction of thefirst magnetic field component MF1 is adjustable by adjusting, forexample, the positional relationships of the magnets 31A and 34A withrespect to the magnetic sensor 20 and the orientations of the magnets31A and 34A. The magnets 31A and 34A are preferably placed to besymmetric with respect to a YZ plane that contains the detectionposition.

In FIG. 6, the arrow labeled MF2 represents the second magnetic fieldcomponent MF2, and the arrow drawn inside the magnet 13 indicates themagnetization direction of the magnet 13. The direction of the secondmagnetic field component MF2 is different from the direction of thefirst magnetic field component MF1. The direction of the target magneticfield MF is different from both of the directions of the first andsecond magnetic field components MF1 and MF2, and is between thosedirections. The variable range of the direction of the target magneticfield MF is below 180°. In the embodiment, specifically, the secondmagnetic field component MF2 is in the −X direction orthogonal to thedirection of the first magnetic field component MF1. In this case, thevariable range of the direction of the target magnetic field MF is below90°.

An example of configuration of the magnetic sensor 20 will now bedescribed with reference to FIG. 7. FIG. 7 is a circuit diagramillustrating the configuration of the magnetic sensor 20. In theembodiment, the magnetic sensor 20 is configured to generate, as adetection signal corresponding to the direction of the target magneticfield MF, a detection signal corresponding to an angle that thedirection of the target magnetic field MF forms with a referencedirection. In the embodiment the reference direction is the X direction.

As shown in FIG. 7, the magnetic sensor 20 includes a Wheatstone bridgecircuit 21 and a difference detector 22. The Wheatstone bridge circuit21 includes a power supply port V configured to receive a predeterminedvoltage, a ground port G connected to the ground, a first output portE1, and a second output port E2.

The Wheatstone bridge circuit 21 further includes a first resistorsection R1, a second resistor section R2, a third resistor section R3,and a fourth resistor section R4. The first resistor section R1 isprovided between the power supply port V and the first output port E1.The second resistor section R2 is provided between the first output portE1 and the ground port G The third resistor section R3 is providedbetween the power supply port V and the second output port E2. Thefourth resistor section R4 is provided between the second output port E2and the ground port G.

The first resistor section R1 includes at least one first MR element.The second resistor section R2 includes at least one second MR element.The third resistor section R3 includes at least one third MR element.The fourth resistor section R4 includes at least one fourth MR element.

In the embodiment, specifically, the first resistor section R1 includesa plurality of first MR elements connected in series, the secondresistor section R2 includes a plurality of second MR elements connectedin series, the third resistor section R3 includes a plurality of thirdMR elements connected in series, and the fourth resistor section R4includes a plurality of fourth MR elements connected in series.

Each of the plurality of MR elements included in the Wheatstone bridgecircuit 21 is a spin-valve MR element. The spin-valve MR elementincludes a magnetization pinned layer having a magnetization whosedirection is fixed, a free layer having a magnetization whose directionis variable according to the direction of the target magnetic field, anda gap layer disposed between the magnetization pinned layer and the freelayer. The spin-valve MR element may be a tunneling magnetoresistive(TMR) element or a giant magnetoresistive (GMR) element. In the TMRelement, the gap layer is a tunnel barrier layer. In the GMR element,the gap layer is a nonmagnetic conductive layer. The spin-valve MRelement varies in resistance according to the angle that themagnetization direction of the free layer forms with the magnetizationdirection of the magnetization pinned layer, and has a minimumresistance when the foregoing angle is 0° and a maximum resistance whenthe foregoing angle is 180°. In FIG. 7, the filled arrows indicate themagnetization directions of the magnetization pinned layers of the MRelements, and the hollow arrows indicate the magnetization directions ofthe free layers of the MR elements.

The magnetization pinned layers of the MR elements in the resistorsections R1 and R4 have magnetizations in a first direction. Themagnetization pinned layers of the MR elements in the resistor sectionsR2 and R3 have magnetizations in a second direction opposite to thefirst direction. The first direction will be denoted by the symbol MP1,and the second direction will be denoted by the symbol MP2. FIG. 6 showsthe first direction MP1 and the second direction MP2. As will bedescribed in detail later, in the embodiment, each of the two directionsorthogonal to the first direction MP1 in the reference plane isdifferent from both of the direction of the first magnetic fieldcomponent MF1 and the direction of the second magnetic field componentMF2. In the reference plane, the two directions orthogonal to the seconddirection MP2 are the same as the two directions orthogonal to the firstdirection MP1. Therefore, in the reference plane, each of the twodirections orthogonal to the second direction MP2 is also different fromboth of the direction of the first magnetic field component MF1 and thedirection of the second magnetic field component MF2.

The electric potential at the output port E1, the electric potential atthe output port E2, and the potential difference between the outputports E1 and E2 vary according to the cosine of the angle that thedirection of the target magnetic field MF forms with the first directionMP1. The difference detector 22 outputs a signal corresponding to thepotential difference between the output ports E1 and E2 as a detectionsignal. The detection signal depends on the electric potential at theoutput port E1, the electric potential at the output port E2, and thepotential difference between the output ports E1 and E2. The detectionsignal varies according to the direction of the target magnetic fieldMF, and therefore corresponds to the direction of the target magneticfield MF.

An example of the configuration of the resistor sections R1, R2, R3 andR4 will now be described with reference to FIG. 8. FIG. 8 is aperspective view illustrating a portion of one of the resistor sectionsR1, R2, R3 and R4. In this example, the resistor section includes aplurality of lower electrodes 162, a plurality of MR elements 150 and aplurality of upper electrodes 163. The plurality of lower electrodes 162are arranged on a substrate (not illustrated). Each of the lowerelectrodes 162 has a long slender shape. Every two lower electrodes 162that are adjacent to each other in the longitudinal direction of thelower electrodes 162 have a gap therebetween. As shown in FIG. 8, MRelements 150 are provided on the top surfaces of the lower electrodes162, near opposite ends in the longitudinal direction. Each of the MRelements 150 includes a free layer 151, a gap layer 152, a magnetizationpinned layer 153, and an antiferromagnetic layer 154 which are stackedin this order, the free layer 151 being closest to the lower electrode162. The free layer 151 is electrically connected to the lower electrode162. The antiferromagnetic layer 154 is formed of an antiferromagneticmaterial. The antiferromagnetic layer 154 is in exchange coupling withthe magnetization pinned layer 153 so as to fix the magnetizationdirection of the magnetization pinned layer 153. The plurality of upperelectrodes 163 are arranged over the plurality of MR elements 150. Eachof the upper electrodes 163 has a long slender shape, and establisheselectrical connection between the respective antiferromagnetic layers154 of two adjacent MR elements 150 that are arranged on two lowerelectrodes 162 adjacent in the longitudinal direction of the lowerelectrodes 162. With such a configuration, in the resistor section shownin FIG. 8 the plurality of MR elements 150 are connected in series bythe plurality of lower electrodes 162 and the plurality of upperelectrodes 163.

It should be appreciated that the layers 151 to 154 of each MR element150 may be stacked in the reverse order to that shown in FIG. 8. Each MRelement 150 may also be configured without the antiferromagnetic layer154. In such a configuration, for example, a magnetization pinned layerof an artificial antiferromagnetic structure, which includes twoferromagnetic layers and a nonmagnetic metal layer interposed betweenthe two ferromagnetic layers, may be provided in place of theantiferromagnetic layer 154 and the magnetization pinned layer 153.

Reference is now made to FIG. 2 to FIG. 5 to describe the operation ofthe driving device 3. The driving device 3 constitutes part of opticalimage stabilization and autofocus mechanisms. Such mechanisms will bebriefly described first. A control unit (not illustrated) external tothe camera module 100 controls the driving device 3, the optical imagestabilization mechanism and the autofocus mechanism.

The optical image stabilization mechanism is configured to detecthand-induced camera shake using, for example, a gyrosensor external tothe camera module 100. Upon detection of hand-induced camera shake bythe optical image stabilization mechanism, the non-illustrated controlunit controls the driving device 3 so as to vary the position of thelens 5 relative to the substrate 7 depending on the mode of the camerashake. This stabilizes the absolute position of the lens 5 to reduce theeffect of the camera shake. The position of the lens 5 relative to thesubstrate 7 is varied in a direction parallel to the U direction orparallel to the V direction, depending on the mode of the camera shake.

The autofocus mechanism is configured to detect a state in which focusis achieved on the subject, using, for example, an image sensor 200 oran autofocus sensor. Using the driving device 3, the non-illustratedcontrol unit varies the position of the lens 5 relative to the substrate7 in a direction parallel to the Z direction so as to achieve focus onthe subject. This enables automatic focusing on the subject.

Next, a description will be given of the operation of the driving device3 related to the optical image stabilization mechanism. When currentsare passed through the coils 41 and 42 by the non-illustrated controlunit, the first holding member 14 with the magnets 31A and 32A fixedthereto moves in a direction parallel to the V direction due tointeraction between the magnetic fields generated by the magnets 31A and32A and the magnetic fields generated by the coils 41 and 42. As aresult, the lens 5 also moves in the direction parallel to the Vdirection. On the other hand, when currents are passed through the coils43 and 44 by the non-illustrated control unit, the first holding member14 with the magnets 33A and 34A fixed thereto moves in a directionparallel to the U direction due to interaction between the magneticfields generated by the magnets 33A and 34A and the magnetic fieldsgenerated by the coils 43 and 44. As a result, the lens 5 also moves inthe direction parallel to the U direction. The non-illustrated controlunit detects the position of the lens 5 by measuring signalscorresponding to the positions of the magnets 31A and 34A, which aregenerated by the two magnetic sensors 30.

Next, the operation of the driving device 3 related to the autofocusmechanism will be described. To move the position of the lens 5 relativeto the substrate 7 in the Z direction, the non-illustrated control unitpasses a current through the coil 45 such that the current flows throughthe first conductor portion 45A in the U direction and flows through thesecond conductor portion 45B in the −U direction, and passes a currentthrough the coil 46 such that the current flows through the firstconductor portion 46A in the −U direction and flows through the secondconductor portion 46B in the U direction. These currents and themagnetic fields generated by the magnets 31A, 31B, 32A and 32B cause aLorentz force in the Z direction to be exerted on the first and secondconductor portions 45A and 45B of the coil 45 and the first and secondconductor portions 46A and 46B of the coil 46. This causes the secondholding member 15 with the coils 45 and 46 fixed thereto to move in theZ direction. As a result, the lens 5 also moves in the Z direction.

To move the position of the lens 5 relative to the substrate 7 in the −Zdirection, the non-illustrated control unit passes currents through thecoils 45 and 46 in directions opposite to those in the case of movingthe position of the lens 5 relative to the substrate 7 in the Zdirection.

The function and effects of the position detection device 1 according tothe embodiment will now be described. The position detection device 1according to the embodiment is used to detect the position of the lens5. In the embodiment, when the position of the lens 5 relative to thesubstrate 7 varies, the position of the second holding member 15 alsovaries relative to each of the substrate 7 and the first holding member14. As previously mentioned, the first holding member 14 holds the firstmagnetic field generation unit 11, and the second holding member 15holds the second magnetic field generation unit 12. Accordingly, whenthe position of the lens 5 relative to the substrate 7 varies asmentioned above, the position of the second magnetic field generationunit 12 relative to the first magnetic field generation unit 11 varies.Hereinafter, the position of the second magnetic field generation unit12 relative to the first magnetic field generation unit 11 will bereferred to as the relative position P12. In the embodiment, therelative position P12 is variable in a direction of the optical axis ofthe lens 5, that is, in a direction parallel to the Z direction.

When the relative position P12 varies, the position of the secondmagnetic field generation unit 12 relative to the substrate 7 varieswhereas the position of the first magnetic field generation unit 11relative to the substrate 7 does not vary. Accordingly, when therelative position P12 varies, the strength of the second magnetic fieldcomponent MF2 varies whereas none of the strength and direction of thefirst magnetic field component MF1 and the direction of the secondmagnetic field component MF2 vary. When the strength of the secondmagnetic field component MF2 varies, the direction and strength of thetarget magnetic field MF vary, and accordingly, the value of thedetection signal to be generated by the magnetic sensor 20 varies. Thevalue of the detection signal varies according to the relative positionP12. The non-illustrated control unit detects the relative position P12by measuring the detection signal. The direction and magnitude ofvariation in the position of the lens 5 relative to the substrate 7 arethe same as those of variation in the relative position P12. Therelative position P12 can thus be indicative of the position of the lens5 relative to the substrate 7.

Reference is now made to FIG. 9 to describe the first and seconddirections MP1 and MP2 and the first and second magnetic fieldcomponents MF1 and MF2. In FIG. 9, the symbol RP represents thereference plane, and the symbol P represents the detection position. InFIG. 9, the arrow labeled MF1 represents the first magnetic fieldcomponent MF1, the arrow labeled MF2 represents the second magneticfield component MF2, and the arrow labeled MF represents the targetmagnetic field. Further, in FIG. 9 the axis in the X directionrepresents the strength Hx of a magnetic field in the X direction, andthe axis in the Y direction represents the strength Hy of a magneticfield in the Y direction.

Since the target magnetic field MF is a composite magnetic field of thefirst and second magnetic field components MF1 and MF2, the direction ofthe target magnetic field MF is different from both of the direction ofthe first magnetic field component MF1 and the direction of the secondmagnetic field component MF2, and is between those directions.

In FIG. 9, the symbols PP1 and PP2 represent two directions orthogonalto the first direction MP1 in the reference plane RP. Two directionsorthogonal to the second direction MP2 in the reference plane RP arealso the directions PP1 and PP2. In the embodiment, as mentionedpreviously, each of the two directions PP1 and PP2 is different fromboth of the direction of the first magnetic field component MF1 and thedirection of the second magnetic field component MF2.

In FIG. 9, the symbol θ represents the angle that the direction of thetarget magnetic field MF forms with the reference direction (the Xdirection) as viewed in a counterclockwise direction from the referencedirection (the X direction). The aforementioned angle θ will be referredto as the target angle θ. The target angle θ is indicative of thedirection of the target magnetic field MF. In the embodiment, themagnetic sensor 20 generates a detection signal corresponding to thetarget angle θ.

The relationship between the relative position P12 and the target angleθ in the embodiment will now be described with reference to FIG. 10.FIG. 10 is a characteristic diagram illustrating the relationshipbetween the relative position P12 and the target angle θ. In FIG. 10,the horizontal axis represents the relative position P12, and thevertical axis represents the target angle θ.

In the embodiment, the distance between the second magnetic fieldgeneration unit 12 and the detection position P when the second magneticfield generation unit 12 is closest to the detection position P isreferred to as the minimum distance. The relative position P12 isrepresented as a value obtained by subtracting the minimum distance fromthe distance between the second magnetic field generation unit 12 at anyposition and the detection position P. In the embodiment, the movablerange of the relative position P12 is set in a range of 0 to 0.3 mm.

In the embodiment, as shown in FIG. 10, as the relative position P12varies over the movable range of 0 to 0.3 mm, the target angle θ variesover a variable range of 207° to 240°. The target angle θ varies in alinear manner with respect to the variations in the relative positionP12. The target angle θ indicates the direction of the target magneticfield MF. Therefore, the variable range of the target angle θcorresponds to the variable range of the direction of the targetmagnetic field MF corresponding to the movable range of the relativeposition P12. In FIG. 9, the range represented by symbol θR is thevariable range of the target angle θ.

In the embodiment, as shown in FIG. 9, each of the two directions PP1and PP2 orthogonal to the magnetization direction of the magnetizationpinned layer in the reference plane RP is different from both of thedirection of the first magnetic field component MF1 and the direction ofthe second magnetic field component MF2. This feature enables theposition detection device 1 according to the embodiment to performposition detection with high precision. This will be discussed below incomparison with a position detection device of a comparative example.

First, the position detection device of the comparative example will bedescribed with reference to FIG. 11. In the position detection device ofthe comparative example, the magnetization directions of themagnetization pinned layers are different from those in the positiondetection device 1 according to the embodiment. In the comparativeexample, the first direction MP1, i.e., the magnetization direction ofthe magnetization pinned layers of the MR elements in the resistorsections R1 and R4, is the −Y direction. The second direction MP2, i.e.,the magnetization direction of the magnetization pinned layers of the MRelements in the resistor sections R2 and R3, is the Y direction. Theremainder of configuration of the position detection device of thecomparative example is the same as that of the position detection device1 according to the embodiment.

FIG. 11 is a diagram corresponding to FIG. 9, showing the first andsecond directions MP1 and MP2 and the first and second magnetic fieldcomponents MF1 and MF2 of the comparative example. In the comparativeexample, the direction PP1, which is one of the two directions PP1 andPP2 orthogonal to the magnetization direction of the magnetizationpinned layers in the reference plane RP, is the same as the direction ofthe second magnetic field component MF2, whereas the other direction PP2is opposite to the direction of the second magnetic field component MF2.

The position detection device of the comparative example has a drawbackas discussed below. Here, for the position detection device 1 accordingto the embodiment and the position detection device of the comparativeexample, an angle that any magnetic field applied to the detectionposition P forms with the reference direction in the reference plane PRwill be referred to as an applied magnetic field angle. FIG. 12 is acharacteristic diagram illustrating the relationship between the appliedmagnetic field angle and a normalized detection signal in thecomparative example. The normalized detection signal is a detectionsignal that is normalized such that its maximum value and minimum valuewhen the applied magnetic field angle is varied over a range of 0° to360° correspond to 1 and −1, respectively. When the potential differencebetween the first output port E1 and the second output port E2 is 0, thenormalized detection signal is 0.

In the comparative example, it is when the direction of the appliedmagnetic field coincides with one of the two directions PP1 and PP2, inother words, when the applied magnetic field angle is 0° or 180°, thatthe potential difference between the first output port E1 and the secondoutput port E2 becomes 0.

Here, the degree of linearity of variations in the detection signal withrespect to variations in the applied magnetic field angle on acharacteristic diagram representing the relationship between the appliedmagnetic field angle and the normalized detection signal, such as FIG.12, will be referred to as linearity of detection signal.

In the comparative example, as shown in FIG. 12, the linearity ofdetection signal is high in a range of the applied magnetic field anglein the vicinity of 0° including 0°, and in a range of the appliedmagnetic field angle in the vicinity of 180° including 180°. In thecomparative example, the linearity of detection signal deteriorates asthe applied magnetic field angle approaches 90° or 270°.

FIG. 12 shows the variable range θR of the target angle θ. In thecomparative example, the variable range θR does not include 0° or 180°,but is away from 0° or 180°. The linearity of detection signal is thuslow in the variable range θR.

In the comparative example, the direction of the target magnetic fieldMF is different from both of the direction of the first magnetic fieldcomponent MF1 and the direction of the second magnetic field componentMF2, and is between those directions. In the comparative example, thedirection PP1, which is one of the two directions PP1 and PP2 orthogonalto the magnetization direction of the magnetization pinned layer in thereference plane PR, coincides with the direction of the second magneticfield component MF2, and the other direction PP2 is opposite to thedirection of the second magnetic field component MF2. Accordingly, inthe comparative example, the direction of the target magnetic field MFcannot coincide with one of the two directions PP1 and PP2. In otherwords, in the comparative example the variable range θR cannot include0° or 180°. Thus, in the comparative example the variable range θRcannot be set in a range in which a high linearity of detection signalis obtained. The comparative example thus has the drawback of beingincapable of performing position detection with high accuracy.

The relative position P12 obtained from the detection signal will bereferred to as position detection value. The comparative example hasanother drawback of having a large error in the position detection valueassociated with temperature variations. This will be discussed belowwith reference to FIG. 13. FIG. 13 is a characteristic diagram similarto FIG. 12. In FIG. 13, each of curves 111 and 112 represents therelationship between the applied magnetic field angle and the normalizeddetection signal for the position detection device of the comparativeexample. The curve 111 represents the aforementioned relationship at afirst temperature, e.g., room temperature. The curve 112 represents theaforementioned relationship at a second temperature higher than thefirst temperature. The normalized detection signal of the curve 112 hasbeen obtained by multiplying the detection signal at the secondtemperature by the ratio of the normalized detection signal at the firsttemperature to the detection signal at the first temperature.

As shown in FIG. 13, the relationship between the applied magnetic fieldangle and the normalized detection signal varies with varyingtemperature. In the comparative example, the aforementioned relationshipvaries largely with temperature variations. The comparative example thushas the drawback that a temperature variation leads to a large error inthe position detection value.

The drawbacks of the comparative example described above also hold truewhen one of the two directions PP1 and PP2 coincides with the directionof the first magnetic field component MF1.

In the position detection device 1 according to the embodiment, thedirection of the target magnetic field MF is different from both of thedirection of the first magnetic field component MF1 and the direction ofthe second magnetic field component MF2, and is between thosedirections. Further, in the embodiment, each of the two directions PP1and PP2 orthogonal to the magnetization direction of the magnetizationpinned layers in the reference plane RP is different from both of thedirection of the first magnetic field component MF1 and the direction ofthe second magnetic field component MF2.

According to the embodiment, it is thus possible to bring one of the twodirections PP1 and PP2 closer to the variable range of the direction ofthe target magnetic field MF than in the comparative example. In otherwords, according to the embodiment, it is possible that an appliedmagnetic field angle at which the normalized detection signal is 0 canbe brought closer to the variable range θR than in the comparativeexample. Accordingly, when compared with the comparative example, theembodiment achieves higher detection accuracy of the MR elements, morespecifically, higher linearity of detection signal, in the variablerange of the direction of the target magnetic field MF, thus enablingposition detection with higher accuracy.

To achieve further enhanced accuracy in position detection in theembodiment, the variable range of the direction of the target magneticfield MF preferably includes one of the two directions PP1 and PP2, inother words, the variable range θR preferably includes an appliedmagnetic field angle at which the normalized detection signal is 0.

To achieve still further enhanced accuracy in position detection in theembodiment, it is more preferable that a direction in the middle of thevariable range of the direction of the target magnetic field MF be thesame as one of the two directions PP1 and PP2. From the same point ofview, it is more preferable that when the relative position P12 is inthe middle of the movable range thereof, the direction of the targetmagnetic field MF be the same as one of the two directions PP1 and PP2.

When the movable range of the relative position P12 is 0 to 0.3 mm andthe variable range θR of the target angle θ is 207° to 240° as shown inFIG. 10, the middle of the movable range of the relative position P12 is0.15 mm. The direction of the target magnetic field MF when the relativeposition P12 is in the middle of the movable range thereof, and thedirection in the middle of the variable range of the direction of thetarget magnetic field MF are both represented by a target angle θ of223.5°. In this case, one of the two directions PP1 and PP2 preferablyforms an angle within the range of 207° to 240°, more preferably anangle of 223.5°, with the reference direction.

FIG. 14 is a characteristic diagram showing an example of therelationship between the applied magnetic field angle and the normalizeddetection signal for the position detection device 1 according to theembodiment. In this example, the direction PP1 forms an angle of 223.5°with the reference direction.

As is apparent from FIG. 14, according to the embodiment, the variablerange θR of the target angle θ can be set at a range in which thelinearity of detection signal is high. This allows the magnetic sensor20 to detect the direction of the target magnetic field MF with highaccuracy, thus allowing the position detection device 1 to performposition detection with high accuracy.

FIG. 15 is a characteristic diagram similar to FIG. 14. In FIG. 15, eachof curves 113 and 114 represents the relationship between the appliedmagnetic field angle and the normalized detection signal for theposition detection device 1 according to the embodiment. The curve 113represents the aforementioned relationship at a first temperature, e.g.,room temperature. The curve 114 represents the aforementionedrelationship at a second temperature higher than the first temperature.The normalized detection signal of the curve 114 has been obtained bymultiplying the detection signal at the second temperature by the ratioof the normalized detection signal at the first temperature to thedetection signal at the first temperature.

In the embodiment, as shown in FIG. 15, the relationship between theapplied magnetic field angle and the normalized detection signal lessvaries with temperature variations in the variable range θR of thetarget angle θ, as compared with the characteristics of the comparativeexample shown in FIG. 13. The embodiment thus enables reduction of errorin the position detection value associated with temperature variations.

Next, a description will be given of a comparison result for accuracy ofposition detection between the position detection device 1 according tothe embodiment and the position detection device of the comparativeexample.

First, with reference to FIG. 16, a description will be given oflinearity parameter, i.e., a parameter representing accuracy of positiondetection. FIG. 16 is a characteristic diagram schematicallyillustrating the relationship between the detection signal and therelative position P12. In FIG. 16, the horizontal axis represents thedetection signal, and the vertical axis represents the relative positionP12.

In FIG. 16, the curve 121 represents an example of the relationshipbetween the detection signal and the relative position P12 in themovable range of the relative position P12. The straight line 122 is aline connecting both ends of the curve 121. Here, let Zr represent arelative position P12 on the curve 121 corresponding to any given valueof the detection signal, and Zi represent a relative position P12 on thestraight line 122 corresponding to the given value of the detectionsignal. Zr—Zi is defined as the value of the linearity parameter Lcorresponding to Zi. The smaller the absolute value of the linearityparameter L throughout the movable range of the relative position P12,the higher accuracy in position detection is obtained.

FIG. 17 is a characteristic diagram illustrating the relationship of therelative position P12 and the target angle θ with the normalizeddetection signal in the comparative example. In FIG. 17 the horizontalaxes represent the relative position P12 and the target angle θ, and thevertical axis represents the normalized detection signal.

FIG. 18 is a characteristic diagram illustrating the relationship of therelative position P12 and the target angle θ with the linearityparameter L in the comparative example. In FIG. 18 the horizontal axesrepresent the relative position P12 and the target angle θ, and thevertical axis represents the linearity parameter L.

FIG. 19 is a characteristic diagram illustrating the relationship of therelative position P12 and the target angle θ with the normalizeddetection signal in the embodiment. In FIG. 19 the horizontal axesrepresent the relative position P12 and the target angle θ, and thevertical axis represents the normalized detection signal.

FIG. 20 is a characteristic diagram illustrating the relationship of therelative position P12 and the target angle θ with the linearityparameter L in the embodiment. In FIG. 20 the horizontal axes representthe relative position P12 and the target angle θ, and the vertical axisrepresents the linearity parameter L.

As is apparent from comparison between FIGS. 18 and 20, the absolutevalue of the linearity parameter L is smaller throughout the movablerange of the relative position P12 in the embodiment than in thecomparative example. This indicates that the embodiment is capable ofperforming position detection with high accuracy.

The present invention is not limited to the foregoing embodiment, andvarious modifications may be made thereto. For example, as far as therequirements of the appended claims are met, the shapes and locations ofthe first and second magnetic field generation units and the location ofthe magnetic sensor 20 are not limited to the respective examplesillustrated in the foregoing embodiment, but can be freely chosen.

Further, as far as the requirements of the appended claims are met, thedirections of the first and second magnetic field components may befreely chosen. For example, the first magnetic field component may be inthe Y or −Y direction, and the second magnetic field component may be inthe Z or −Z direction. In such a case, the reference plane is a planeperpendicular to the X direction.

Further, the magnetic sensor 20 may be configured without the Wheatstonebridge circuit 21 and the difference detector 22. For example, themagnetic sensor 20 may be configured to include the power supply port V,the ground port G the first output port E1, and the first and secondresistor sections R1 and R2, and include none of the second output portE2, the third and fourth resistor sections R3 and R4, and the differencedetector 22. In such a case, the detection signal is a signal dependenton the electric potential at the first output port E1.

The position detection device of the present invention is usable todetect not only a lens position but also the position of any objectmoving in a predetermined direction.

Obviously, many modifications and variations of the present inventionare possible in the light of the above teachings. Thus, it is to beunderstood that, within the scope of the appended claims and equivalentsthereof, the invention may be practiced in other embodiments than theforegoing most preferable embodiment.

What is claimed is:
 1. A magnetic sensor for generating, at a detectionposition in a reference plane, a detection signal corresponding to adirection of a detection-target magnetic field that varies within avariable range below 90° in the reference plane, comprising at least onemagnetoresistive element, wherein the at least one magnetoresistiveelement, which is a tunnel magnetoresistive element or a giantmagnetoresistive element, includes a magnetization pinned layer having amagnetization whose direction is fixed, and a free layer having amagnetization whose direction is variable according to the direction ofthe detection-target magnetic field, the reference plane is a plane thatcontains the direction of the magnetization of the magnetization pinnedlayer and the direction of the detection-target magnetic field, and oneof two directions (1) orthogonal to the direction of the magnetizationof the magnetization pinned layer and (2) in the reference plane iscontained in the variable range of the direction of the detection-targetmagnetic field.
 2. The magnetic sensor according to claim 1, wherein theone of the two directions orthogonal to the direction of themagnetization of the magnetization pinned layer is the same as adirection in the middle of the variable range of the direction of thedetection-target magnetic field.
 3. The magnetic sensor according toclaim 1, wherein the at least one magnetoresistive element is at leastone first magnetoresistive element and at least one secondmagnetoresistive element, the magnetic sensor further includes a powersupply port configured to receive a predetermined voltage, a ground portconnected to a ground, and an output port, the at least one firstmagnetoresistive element is provided between the power supply port andthe output port, the at least one second magnetoresistive element isprovided between the output port and the ground port, the magnetizationof the magnetization pinned layer of the at least one firstmagnetoresistive element is in a first direction, the magnetization ofthe magnetization pinned layer of the at least one secondmagnetoresistive element is in a second direction opposite to the firstdirection, and the detection signal depends on an electric potential atthe output port.
 4. The magnetic sensor according to claim 1, whereinthe at least one magnetoresistive element is at least one firstmagnetoresistive element, at least one second magnetoresistive element,at least one third magnetoresistive element, and at least one fourthmagnetoresistive element, the magnetic sensor further includes a powersupply port configured to receive a predetermined voltage, a ground portconnected to a ground, a first output port, and a second output port,the at least one first magnetoresistive element is provided between thepower supply port and the first output port, the at least one secondmagnetoresistive element is provided between the first output port andthe ground port, the at least one third magnetoresistive element isprovided between the power supply port and the second output port, theat least one fourth magnetoresistive element is provided between thesecond output port and the ground port, the magnetization of themagnetization pinned layer of the at least one first magnetoresistiveelement and the magnetization of the magnetization pinned layer of theat least one fourth magnetoresistive element are in a first direction,the magnetization of the magnetization pinned layer of the at least onesecond magnetoresistive element and the magnetization of themagnetization pinned layer of the at least one third magnetoresistiveelement are in a second direction opposite to the first direction, andthe detection signal depends on a potential difference between the firstoutput port and the second output port.
 5. A position detection devicecomprising the magnetic sensor according to claim 1, the positiondetection device further comprising: a first magnetic field generationunit for generating a first magnetic field; a second magnetic fieldgeneration unit for generating a second magnetic field, the secondmagnetic field generation unit being provided such that its positionrelative to the first magnetic field generation unit is variable; afirst holding member for holding the first magnetic field generationunit; and a second holding member for holding the second magnetic fieldgeneration unit, the second holding member being provided such that itsposition is variable in one direction relative to the first holdingmember.
 6. The position detection device according to claim 5, whereinthe detection-target magnetic field is a composite magnetic field of afirst magnetic field component of the first magnetic field and a secondmagnetic field component of the second magnetic field.
 7. The positiondetection device according to claim 5, wherein the second holding memberis configured to hold a lens, and is provided such that its position isvariable in a direction of an optical axis of the lens relative to thefirst holding member.
 8. The position detection device according toclaim 5, wherein when the position of the second magnetic fieldgeneration unit relative to the first magnetic field generation unitvaries, a strength of a second magnetic field component varies whereasnone of a strength and direction of a first magnetic field component anda direction of the second magnetic field component vary, where the firstmagnetic field component is a component of the first magnetic field atthe detection position, the component of the first magnetic field beingparallel to the reference plane, and the second magnetic field componentis a component of the second magnetic field at the detection position,the component of the second magnetic field being parallel to thereference plane.
 9. The position detection device according to claim 8,wherein the detection-target magnetic field is a composite magneticfield of the first magnetic field component of the first magnetic fieldand the second magnetic field component of the second magnetic field.